package basicobject

import (
	"yizhuoyan/go-study/pdfgo/handyio"
)

type nullObject struct {
}

var Null = &nullObject{}

var nullBytes = []byte("null")

func (this *nullObject) Serialize(w handyio.PdfRawWriter) error {
	w.WriteBytes(nullBytes)
	return nil
}

func (this *nullObject) UnSerialize(r handyio.PdfRawReader) error {
	if !r.NextBytesEquals(nullBytes) {
		return r.NotSupport("")
	}
	return nil
}
